package com.imti.roomdemo;

import android.content.Context;
import androidx.room.Room;
import androidx.room.RoomDatabase;

public class DBHelper
{

    private static DBHelper sInstance;

    private Context mContext;

    private DBHelper(Context context)
    {
        this.mContext = context;
    }

    public static DBHelper getInstance(Context context)
    {
        if (null == sInstance)
        {
            sInstance = new DBHelper(context);
        }

        return sInstance;
    }

    public MyDatabase getDB()
    {
        return Room.databaseBuilder(
            mContext, MyDatabase.class, "room_database.db")
                   .build();
    }
}
